let routes = [
    {
        path: '/',
        // redirect 将'/' 路径重定向为 '/index'
        redirect: '/index',
        component: ()=>import('@/App'),
    },
    {
        path: '/index',
        component: ()=>import('@/views/Index'),
    },
    {
        path: '/hotExpo',
        component: ()=>import('@/views/indexInside/HotExpo'),
    },
    {
        path: '/paintingInside',
        component: ()=>import('@/views/indexInside/PaintingInside'),
    },
    {
        path: '/class',
        component: ()=>import('@/views/Class'),
        name: 'class',
        redirect: {name: 'style'},
        children:[
            {path: 'style', name: 'style', component: ()=>import('@/components/class/ClassStyle')},
            {path: 'theme', name: 'theme', component: ()=>import('@/components/class/ClassTheme')},
            {path: 'country', name: 'country', component: ()=>import('@/components/class/ClassCountry')},
            {path: 'painter', name: 'painter', component: ()=>import('@/components/class/ClassPainter')},
            
        ] 
    },
    {
        path: '/community',
        component: ()=>import('@/views/Community'),
        name: 'community',
        redirect: {name: 'circle'},
        children: [
            {path: 'focus',meta: { requiresAuth: true }, name: 'focus', component: ()=>import('@/components/community/CommunityFocus')},
            {path: 'circle', name: 'circle', component: ()=>import('@/components/community/CommunityCircle')},
            {path: 'topics', name: 'topics', component: ()=>import('@/components/community/CommunityTopics')},
        ]
    },
    // 社区-新闻详情
    {
        
        path: '/newsDetail:id',
        name: 'newsDetail',  
        // 接收参数
        props: true,
        component: ()=>import('@/views/NewsDetail')
    },

    // 作品详情
    {
        
        path: '/workDetails:id',
        name: 'workDetails',
        // 接收参数
        props: true,
        component: ()=>import('@/views/WorkDetails')
    },

    // 社区帖子发布页
    {
        path: '/publish',
        name: 'publish',
        meta: { requiresAuth: true },
        component: ()=>import('@/views/communityInside/Publish.vue')
    },
    // 
    // {
    //     path: '/login',
    //     name: 'login',
    //     component: ()=>import('@/views/Login')
    // },
    {
        path: '/mine',
        name: 'mine',
        // meta: { requiresAuth: true },
        component: ()=>import('@/views/Mine')
    },
    {
        path: '/user',
        name: 'user',
        component: ()=>import('@/views/User'),
        children: [
            {path: 'login',name: 'login',component: ()=>import('@/components/user/Login')},
            {path: 'register',name: 'register',component: ()=>import('@/components/user/Register')},
        ],
    },
    {
        path: '/setting',
        name: 'setting',
        // meta: { requiresAuth: true },
        component: ()=>import('@/views/Setting'),
    },
    // 创建错误路径的路由
    {
        path: '*',
        component: ()=>import('@/views/Error')
    },

    {
        path: '/commentList',
        component: ()=>import('@/components/pub/CommentList')
    },
]

export default routes